<template>
  <div id="info">
    <div id="d-info">
      <p id="p-info" v-text="info" v-on:change="toBottom()"></p>
    </div>
  </div>
</template>

<script>
export default {
  name: "info",
  data() {
    return {}
  },
  computed: {
    info: function () {
      return this.$store.state.model.info
    }
  },
  methods: {
    toBottom: function () {
      let p = document.getElementById('p-info');
      p.scrollTop = p.scrollHeight;
    }
  }
}
</script>

<style scoped>
#info {
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  border: 2px solid #0c88c1;
  min-height: 300px;
  max-height: 300px;
  background: #feffec;
}

#d-info {
  padding: 2em;
}

#p-info {
  white-space: pre-line;
  margin: 0;
  height: 240px;
  overflow-y: scroll;
  font-family: Simulator, sans-serif;
}
</style>